/*
 * @Description: 全宗表格组件
 * @Author: Rfan
 * @Date: 2022-01-07 15:20:55
 * @LastEditTime: 2022-01-10 10:56:08
 */

import * as React from 'react';
import { Button, Modal, Space, Table } from 'antd';
const { Column } = Table;

const FileTable = () => {
  // 删除类型
  const delItem = (id) => {
    console.log('del', id);
    Modal.confirm({
      title: '删除',
      content: '确认删除该档案类型？',
      onOk() {},
      onCancel() {
        console.log('Cancel');
      }
    });
  };

  // 切换页码触发
  const pageChange = (page, pageSize) => {};

  return (
    <Table
      dataSource={list}
      loading={loading}
      pagination={{
        current: listQuery.pageNo,
        pageSize: listQuery.pageSize,
        total,
        onChange: pageChange
      }}
    >
      <Column title="ID" dataIndex="id" key="id" align="center" />
      <Column title="code" dataIndex="fondCode" key="fondCode" align="center" />
      <Column title="name" dataIndex="fondName" key="fondName" align="center" />
      <Column
        title="Action"
        key="action"
        align="center"
        render={(text, record, index) => (
          <Space size="middle">
            <Button type="text">查看下级</Button>
            <Button
              type="text"
              danger
              disabled
              onClick={() => {
                delItem(record.id);
              }}
            >
              删除
            </Button>
          </Space>
        )}
      />
    </Table>
  );
};

export default FileTable;
